require('@assets/css/app.css')
$['components-jq'] = {
	loginComp: {},
	mainComp: {},
	userComp: {},
	teamComp: {},
	apiComp: {},
	templateComp: {},
	apiTestComp: {},
	projectComp: {},
	infoComp: {},
	bugComp: {},
	store: {},
}
$.storage = {}
const spaRouters = require('@utils/spa-routers')

$._ulType = (val) => {
	switch ($.type(val)) {
		case 'number':
			return 'number';
		case 'boolean':
			return 'boolean';
		case 'array':
			{
				let type = val[0] && typeof val[0] || 'string'
				return `array[${type}]`;
			}
		case 'object':
			return 'object';
		case 'undefined':
			return 'undefined';
		default:
			return 'string';
	}
};

$(function() {
	$("#app").height(window.innerHeight)
	spaRouters.start({
		view: "#app",
		router: {
			index: {
				component: {
					page(resolve) {
						import ('@views/login/index.html').then(resolve);
						// import ('@views/login/login-bak.html').then(resolve);
					},
					// init: require('@modules/login'),
					init: require('@modules/login/init-login'),
				}
			},
			main: {
				component: {
					// page(resolve) {
					// 	import('@views/main/main.html').then(resolve);
					// },
					page: '<div id="main-layout"></div>',
					init: require('@modules/main/init-main'),
				}
			},
			defaults: 'index',
		}
	})
	$.spaRouters = spaRouters
})